# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=tellico
pkgver=4.0.1
pkgrel=0
pkgdesc="Collection management software, free and simple"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt6-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://tellico-project.org/"
license="GPL-2.0-only"
makedepends="
	exempi-dev
	extra-cmake-modules
	karchive-dev
	kcodecs-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdoctools-dev
	kfilemetadata-dev
	kguiaddons-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kitemmodels-dev
	kjobwidgets-dev
	knewstuff-dev
	ktextwidgets-dev
	kwallet-dev
	kwidgetsaddons-dev
	kwindowsystem-dev
	kxmlgui-dev
	libcdio-dev
	libkcddb-dev
	libksane-dev
	poppler-qt5-dev
	qt6-qtbase-dev
	qt6-qtcharts-dev
	qt6-qtwebengine-dev
	samurai
	solid-dev
	sonnet-dev
	taglib-dev
	"
checkdepends="xvfb-run"
source="https://tellico-project.org/files/tellico-$pkgver.tar.xz
	0001-tellico-define-strdup.patch
	"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "(newstuff|htmlexporter)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
d4b54a9c1a65928cf19bd8134723d454950d154bb9eeee47e5cb21fa1e9497192714d4222a02b63627d7d49248f3da794c76ce7dae22cec2496d44ad8cf850ee  tellico-4.0.1.tar.xz
0a8efadd382f75773d75c8800c8eb2ba6312291d62e8b9504d9e09188c6fdfec2d7b0e4674b62d406e7fdde43dd18aa5a63dc9dc919e4b61bba8c01776abfa9c  0001-tellico-define-strdup.patch
"
